package com.tjp.subject.common.enums;

import lombok.Getter;

/**
 * @program: jz-club
 * @description: 题目类型枚举类  1.单选 2.多选 3.判断 4.简答
 * @author: aaronTang
 * @create: 2024-02-22
 */
@Getter
public enum SubjectInfoTypeEnum {

    RADIO(1, "单选"),
    MULTIPLE(2, "多选"),
    JUDGE(3, "判断"),
    BRIEF(4, "简答");


    public int code;
    public String desc;

    SubjectInfoTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubjectInfoTypeEnum getByCode(int codeVal) {
        for (SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()) {
            if (resultCodeEnum.getCode() == codeVal) {
                return resultCodeEnum;
            }
        }
        return null;
    }


}
